/*
 * EbenoPanelo.java
 *
 * Created on 17 październik 2007, 12:51
 */

package pla;

/**
 *
 * @author  arkadiusz
 */
public class EbenoPanelo extends javax.swing.JPanel {
   Plaszczyzny ebeno = null;
   
   /** Creates new form EbenoPanelo */
   public EbenoPanelo() {
      initComponents();
   }
   public EbenoPanelo(pla.Plaszczyzny p) {    
      this.ebeno = p;
      initComponents();
    //  this.dimCelo.getModel().setValue(this.ebeno.dimCelo);
   }
   
   public int getPorEbeno3D(){
      return this.porEbeno3D.getValue();
   }
   public int getPorOdcinek(){
      return this.porOdcinek.getValue();
   }   
   
   
   /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    */
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    dimCelo = new javax.swing.JSpinner();
    jButton1 = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    porEbeno3D = new javax.swing.JSlider();
    jLabel4 = new javax.swing.JLabel();
    porOdcinek = new javax.swing.JSlider();
    jButton2 = new javax.swing.JButton();

    setBackground(new java.awt.Color(102, 204, 255));

    jLabel1.setText("Rozmiar komorki:");

    dimCelo.addChangeListener(new javax.swing.event.ChangeListener() {
      public void stateChanged(javax.swing.event.ChangeEvent evt) {
        dimCeloStateChanged(evt);
      }
    });

    jButton1.setText("Pokaz wizualizacje - Odcinki");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton1ActionPerformed(evt);
      }
    });

    jLabel3.setText("podobienstwo Plaszczyzn:");

    porEbeno3D.setMajorTickSpacing(5);
    porEbeno3D.setMinimum(80);
    porEbeno3D.setMinorTickSpacing(1);
    porEbeno3D.setPaintLabels(true);
    porEbeno3D.setPaintTicks(true);
    porEbeno3D.setSnapToTicks(true);
    porEbeno3D.setValue(98);

    jLabel4.setText("podobienstwo Odcinkow:");

    porOdcinek.setMajorTickSpacing(5);
    porOdcinek.setMinimum(80);
    porOdcinek.setMinorTickSpacing(1);
    porOdcinek.setPaintLabels(true);
    porOdcinek.setPaintTicks(true);
    porOdcinek.setSnapToTicks(true);
    porOdcinek.setValue(98);

    jButton2.setText("Pokaz wizualizacje - Plaszczyzny");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton2ActionPerformed(evt);
      }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
              .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)
              .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(dimCelo, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addComponent(porEbeno3D, javax.swing.GroupLayout.DEFAULT_SIZE, 467, Short.MAX_VALUE)))
          .addGroup(layout.createSequentialGroup()
            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(porOdcinek, javax.swing.GroupLayout.DEFAULT_SIZE, 467, Short.MAX_VALUE))
          .addGroup(layout.createSequentialGroup()
            .addComponent(jButton1)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jButton2)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
        .addContainerGap())
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(dimCelo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel1))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel3)
          .addComponent(porEbeno3D, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addGap(11, 11, 11)
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(layout.createSequentialGroup()
            .addComponent(jLabel4)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 93, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
              .addComponent(jButton1)
              .addComponent(jButton2)))
          .addComponent(porOdcinek, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addContainerGap())
    );
  }// </editor-fold>//GEN-END:initComponents

  private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
    this.ebeno.showGraphic2();
  }//GEN-LAST:event_jButton2ActionPerformed

  private void dimCeloStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_dimCeloStateChanged
   //this.ebeno.dimCelo = (Integer)(this.dimCelo.getValue());
  }//GEN-LAST:event_dimCeloStateChanged
   
   private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
      this.ebeno.showGraphic();
   }//GEN-LAST:event_jButton1ActionPerformed
   

  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JSpinner dimCelo;
  private javax.swing.JButton jButton1;
  private javax.swing.JButton jButton2;
  private javax.swing.JLabel jLabel1;
  private javax.swing.JLabel jLabel3;
  private javax.swing.JLabel jLabel4;
  private javax.swing.JSlider porEbeno3D;
  private javax.swing.JSlider porOdcinek;
  // End of variables declaration//GEN-END:variables
   
}
